package com.wanxi.change;

import java.io.*;

public class MyChangeIO {
    public static void main(String[] args) throws Exception {
//        InputStream inputStream=new FileInputStream("");
//        InputStreamReader inputStreamReader=new InputStreamReader(inputStream);
//        inputStreamReader.read();
//        char[] chars=new char[11];
//        inputStreamReader.read(chars);
        String path = "E:\\wanxi\\step-2\\java02-0921\\day21OtherIOStream\\src\\com\\wanxi/dir";
        String fileName = "a.txt";
        File dir = new File(path);
        dir.mkdirs();
        File file = new File(dir, fileName);
        OutputStream outputStream = new FileOutputStream(file);
        OutputStreamWriter outputStreamWriter = new OutputStreamWriter(outputStream);
        outputStreamWriter.write("aaa");
        outputStreamWriter.flush();//刷新，意味着后面还可能用这个流，不急于关闭
        outputStreamWriter.close();//一般关闭在finally，关闭默认在之前做了一次刷新
    }
}
